import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:untitled1/app/broker/modules/WebViewPage.dart';
import 'package:untitled1/app/broker/modules/serve/ServeBasicInfoUpdate.dart';
import 'package:untitled1/app/widgets/NetworkPdfViewerPage.dart';
import 'package:untitled1/app/res/myColors.dart';
import 'package:untitled1/app/utils/utilDialog.dart';
import 'package:untitled1/app/utils/utilScreen.dart';
import 'package:untitled1/app/widgets/TitleBar.dart';
import 'package:untitled1/app/widgets/dialog/MyBottomDialog2.dart';
import 'package:untitled1/app/widgets/toast/MyToast.dart';

import '../../../utils/utilRouter.dart';
import '../../../widgets/image/ImageListView.dart';
import '../../../widgets/image/ImagePreviewFullscreen.dart';
import '../../../widgets/image/ImagePreview.dart';
import '../../../widgets/MyGrid.dart';
import '../../../widgets/TextSelector.dart';
import '../../../widgets/base_page/BaseStatefulPage.dart';
import '../../../widgets/dialog/MyBottomDialog.dart';
import '../employer/employer_page/employer_page_dialog/CountdownTextSplit.dart';
import 'ServeRecordPage.dart';
import 'ServeResume.dart';

class ServeDetailPage extends BaseStatefulPage {
  @override
  BaseStatefulPageState<BaseStatefulPage> createState() {
    return _ServePeopleDetailPageState();
  }
}

class _ServePeopleDetailPageState
    extends BaseStatefulPageState<ServeDetailPage> {
  @override
  Widget buildPage(BuildContext context) {
    return Scaffold(
      appBar: TitleBar(title: "简历详情"),
      body: Container(
        decoration: BoxDecoration(
          image: DecorationImage(
            image: AssetImage('assets/app/fwry_bg.png'),
            fit: BoxFit.cover, // 设置图片填充方式
            alignment: Alignment.center, // 设置图片的位置
          ),
        ),
        child: Column(
          children: [
            Expanded(
              child: Stack(
                children: [
                  SingleChildScrollView(
                    child: Container(
                      padding: EdgeInsets.only(bottom: 200),
                      child: Column(
                        children: [
                          SizedBox(height: 10),
                          Container(
                            margin: EdgeInsets.only(left: 15, right: 15),
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
                              children: [
                                Row(
                                  children: [
                                    Image.asset(
                                      'assets/app/tuijian.png',
                                      height: 20,
                                      width: 20,
                                    ),
                                    SizedBox(width: 5),
                                    Text('被推荐'),
                                    Text(
                                      "300次",
                                      style: TextStyle(
                                        fontSize: 14,
                                        fontWeight: FontWeight.bold,
                                        color: Color(0xff947031),
                                      ),
                                    ),
                                  ],
                                ),
                                Text(
                                  'NO. JY888888888',
                                  style: TextStyle(
                                    fontSize: 14,
                                    fontWeight: FontWeight.bold,
                                    color: Color(0xff947031),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            width: MediaQuery.of(context).size.width,
                            margin: EdgeInsets.only(
                              left: 10,
                              right: 10,
                              top: 10,
                            ),
                            decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(5),
                            ),
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Container(
                                  alignment: Alignment.centerRight,
                                  child: Container(
                                    padding: EdgeInsets.all(3),
                                    decoration: BoxDecoration(
                                      color: Color(0xFFDFBF973D),
                                      borderRadius: BorderRadius.only(
                                        topRight: Radius.circular(5),
                                        bottomLeft: Radius.circular(5),
                                      ),
                                    ),
                                    child: Text(
                                      '发起定金合同',
                                      style: TextStyle(
                                        color: Color(0xff947031B2),
                                        fontSize: 14,
                                      ),
                                    ),
                                  ),
                                ),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Row(
                                    children: [
                                      Image.asset(
                                        'assets/app/nvshi.png',
                                        height: 50,
                                        width: 50,
                                      ),
                                      SizedBox(width: 10),
                                      Expanded(
                                        child: Column(
                                          crossAxisAlignment:
                                              CrossAxisAlignment.start,
                                          children: [
                                            Text(
                                              '张女士',
                                              style: TextStyle(
                                                fontSize: 16,
                                                fontWeight: FontWeight.bold,
                                                color: Colors.black,
                                              ),
                                            ),
                                            SizedBox(height: 5),
                                            Text(
                                              '8年以上经验｜服务100以上雇主',
                                              style: TextStyle(
                                                fontSize: 12,
                                                color: Colors.black,
                                              ),
                                            ),
                                            SizedBox(height: 5),
                                            Divider(height: 1, thickness: 1),
                                          ],
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                                SizedBox(height: 10),
                                Row(
                                  children: [
                                    SizedBox(width: 10),
                                    Text(
                                      "内蒙古人 38岁 本科 虎 摩西座 汉族",
                                      style: TextStyle(
                                        fontSize: 14,
                                        color: myColors.c_707070,
                                      ),
                                    ),
                                    SizedBox(width: 10),
                                    Expanded(
                                      child: GestureDetector(
                                        onTap: () async {
                                          print(">]aaaaaabbbbbb");
                                          final List<String> imageUrls = const [
                                            'http://gips3.baidu.com/it/u=1821127123,1149655687&fm=3028&app=3028&f=JPEG&fmt=auto?w=720&h=1280',
                                            'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960',
                                            'https://gips3.baidu.com/it/u=1039279337,1441343044&fm=3028&app=3028&f=JPEG&fmt=auto&q=100&size=f1024_1024',
                                          ];
                                          // MyBottomDialog.show(
                                          //   context: context,
                                          //   builder:
                                          //       (context) =>
                                          //           ImageListView(
                                          //             imageUrls: imageUrls,
                                          //           ),
                                          //   height: utilScreen.getScreenHeight(
                                          //     context,
                                          //   ),
                                          //   width: utilScreen.getScreenWidth(
                                          //     context,
                                          //   ),
                                          // );
                                          String pdfUrl =
                                              'https://cdn.syncfusion.com/content/PDFViewer/flutter-succinctly.pdf';
                                          MyBottomDialog.show(
                                            context: context,
                                            builder:
                                                (context) =>
                                                    NetworkPdfViewerPage(url: pdfUrl,),
                                            height: utilScreen.getScreenHeight(
                                              context,
                                            ),
                                            width: utilScreen.getScreenWidth(
                                              context,
                                            ),
                                          );
                                        },
                                        child: Container(
                                          margin: EdgeInsets.only(right: 10),
                                          alignment: Alignment.centerRight,
                                          child: Text(
                                            '体检报告>',
                                            style: TextStyle(
                                              fontSize: 14,
                                              color: myColors.c_FF4142,
                                              fontWeight: FontWeight.bold,
                                            ),
                                          ),
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                                SizedBox(height: 10),
                                Row(
                                  children: [
                                    SizedBox(width: 10),
                                    Text(
                                      "英语4级 普通话 四川话良好 手脚勤快",
                                      style: TextStyle(
                                        fontSize: 14,
                                        color: myColors.c_707070,
                                      ),
                                    ),
                                  ],
                                ),
                                SizedBox(height: 20),
                                getTitleContent('档期时间'),
                                SizedBox(height: 5),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    "2025.07.02",
                                    style: TextStyle(
                                      fontSize: 14,
                                      color: myColors.c_707070,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 15),
                                getTitleContent('求职意向'),
                                SizedBox(height: 5),
                                Container(
                                  padding: EdgeInsets.only(left: 10, right: 10),
                                  child: Row(
                                    mainAxisAlignment:
                                        MainAxisAlignment.spaceBetween,
                                    children: [
                                      Text(
                                        '工种：家员私厨',
                                        style: TextStyle(
                                          color: myColors.c_707070,
                                          fontSize: 14,
                                        ),
                                      ),
                                      Text(
                                        '10000-20000/时薪',
                                        style: TextStyle(
                                          fontSize: 16,
                                          fontWeight: FontWeight.bold,
                                          color: Color(0xFFB51C21),
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                                SizedBox(height: 5),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    '工作内容: 接孩子、家庭五口一日三餐、整理房间、清洁房间、开车接孩子上下学、剩下就是产品文档了。接孩子、家庭五口一日三餐、整理房间、清洁房间、开车剩下就是产品文档了。',
                                    style: TextStyle(
                                      color: myColors.c_707070,
                                      fontSize: 14,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 5),
                                Row(
                                  children: [
                                    SizedBox(width: 10),
                                    Image.asset(
                                      'assets/app/home_dw.png',
                                      height: 15,
                                      width: 15,
                                    ),
                                    SizedBox(width: 5),
                                    Text(
                                      "xxx省xxx城市 可随从",
                                      style: TextStyle(
                                        color: myColors.c_707070,
                                        fontSize: 14,
                                      ),
                                    ),
                                  ],
                                ),
                                SizedBox(height: 5),
                                Row(
                                  children: [
                                    SizedBox(width: 10),
                                    SizedBox(width: 5),
                                    Text(
                                      "全职",
                                      style: TextStyle(
                                        color: myColors.c_707070,
                                        fontSize: 14,
                                      ),
                                    ),
                                    SizedBox(width: 5),
                                    Text(
                                      "白班",
                                      style: TextStyle(
                                        color: myColors.c_707070,
                                        fontSize: 14,
                                      ),
                                    ),
                                    SizedBox(width: 5),
                                    Text(
                                      "B/C端",
                                      style: TextStyle(
                                        color: myColors.c_707070,
                                        fontSize: 14,
                                      ),
                                    ),
                                  ],
                                ),
                                SizedBox(height: 10),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    "所持证书",
                                    style: TextStyle(
                                      fontSize: 14,
                                      fontWeight: FontWeight.bold,
                                      color: myColors.c_191919,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 5),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: SingleChildScrollView(
                                    scrollDirection: Axis.horizontal,
                                    child: Row(
                                      children: [
                                        for (int i = 0; i < 5; i++)
                                          GestureDetector(
                                            onTap: () {
                                              ImagePreview.show(
                                                context,
                                                images: [
                                                  'http://gips3.baidu.com/it/u=1821127123,1149655687&fm=3028&app=3028&f=JPEG&fmt=auto?w=720&h=1280',
                                                  'http://gips2.baidu.com/it/u=195724436,3554684702&fm=3028&app=3028&f=JPEG&fmt=auto?w=1280&h=960',
                                                  'https://gips3.baidu.com/it/u=1039279337,1441343044&fm=3028&app=3028&f=JPEG&fmt=auto&q=100&size=f1024_1024',
                                                ],
                                                initialIndex: 0,
                                              );
                                            },
                                            child: Container(
                                              alignment: Alignment.center,
                                              margin: EdgeInsets.only(
                                                left: 10,
                                                right: 10,
                                              ),
                                              width: 120,
                                              height: 80,
                                              decoration: BoxDecoration(
                                                borderRadius:
                                                    BorderRadius.circular(5),
                                                border: Border.all(
                                                  color: Color(0xff9ED0E6),
                                                  // 边框颜色
                                                  width: 5.0, // 边框宽度
                                                ),
                                              ),
                                              child: Column(
                                                mainAxisAlignment:
                                                    MainAxisAlignment.center,
                                                crossAxisAlignment:
                                                    CrossAxisAlignment.center,
                                                children: [
                                                  Image.asset(
                                                    'assets/app/zhengshu.png',
                                                    height: 30,
                                                    width: 30,
                                                  ),
                                                  Text(
                                                    "证书名称",
                                                    style: TextStyle(
                                                      fontSize: 14,
                                                      color: myColors.c_191919,
                                                    ),
                                                  ),
                                                ],
                                              ),
                                            ),
                                          ),
                                      ],
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          SizedBox(height: 10),
                          Container(
                            width: MediaQuery.of(context).size.width,
                            margin: EdgeInsets.only(left: 15, right: 15),
                            padding: EdgeInsets.only(bottom: 10, top: 10),
                            decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(5),
                            ),
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                getTitleContent('关于我'),
                                SizedBox(height: 10),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    '自我介绍',
                                    style: TextStyle(
                                      fontSize: 14,
                                      color: myColors.c_191919,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 5),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    '内蒙古人，能做家庭餐、做家务，能够独自整理收纳家务、熨烫衣服。为人性格开朗，干净利索。',
                                    style: TextStyle(
                                      fontSize: 14,
                                      color: myColors.c_707070,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 10),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    '家庭情况',
                                    style: TextStyle(
                                      fontSize: 14,
                                      color: myColors.c_191919,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 5),
                                Container(
                                  padding: EdgeInsets.only(left: 10, right: 10),
                                  child: Column(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        "婚姻情况: 已婚已育",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                      Text(
                                        "老人情况: 两位老人、70岁左右",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                      Text(
                                        "子女情况: 一个男孩，上初三",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                      Text(
                                        "宠物情况: 有一只金毛犬",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                                SizedBox(height: 10),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    '其他',
                                    style: TextStyle(
                                      fontSize: 14,
                                      color: myColors.c_191919,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 5),
                                Container(
                                  padding: EdgeInsets.only(left: 10, right: 10),
                                  child: Column(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        "居住地址: 北京市西城区",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                      Text(
                                        "禁忌内容: 希望雇主没有民族歧视、地域歧视。",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                      Text(
                                        "宗教信仰: 基督教",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            width: MediaQuery.of(context).size.width,
                            margin: EdgeInsets.only(left: 15, right: 15),
                            padding: EdgeInsets.only(bottom: 10, top: 10),
                            decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(5),
                            ),
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                getTitleContent('经纪人推荐'),
                                SizedBox(height: 10),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: MyGrid(
                                    children: List.generate(
                                      4,
                                      (index) => Container(
                                        height: 20,
                                        alignment: Alignment.center,
                                        decoration: BoxDecoration(
                                          borderRadius: BorderRadius.circular(
                                            3,
                                          ),
                                          color: Color(0xffF4F5F6),
                                        ),

                                        child: Text(
                                          'Item $index',
                                          style: TextStyle(
                                            color: myColors.c_191919,
                                          ),
                                        ),
                                      ),
                                    ),
                                    columnCount: 4, // 每行 4 列
                                  ),
                                ),
                                SizedBox(height: 10),
                                getTitleContent('雇主评价'),
                                SizedBox(height: 10),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: MyGrid(
                                    children: List.generate(
                                      4,
                                      (index) => Container(
                                        height: 20,
                                        alignment: Alignment.center,
                                        decoration: BoxDecoration(
                                          borderRadius: BorderRadius.circular(
                                            3,
                                          ),
                                          color: Color(0xffF4F5F6),
                                        ),

                                        child: Text(
                                          'Item $index',
                                          style: TextStyle(
                                            color: myColors.c_191919,
                                          ),
                                        ),
                                      ),
                                    ),
                                    columnCount: 4, // 每行 4 列
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            width: MediaQuery.of(context).size.width,
                            margin: EdgeInsets.only(left: 15, right: 15),
                            padding: EdgeInsets.only(bottom: 10, top: 10),
                            decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(5),
                            ),
                            child: Column(
                              crossAxisAlignment: CrossAxisAlignment.start,
                              children: [
                                Row(
                                  mainAxisAlignment:
                                      MainAxisAlignment.spaceBetween,
                                  children: [
                                    getTitleContent('工作经历'),
                                    Container(
                                      margin: EdgeInsets.only(right: 10),
                                      child: Text(
                                        "更多>",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_191919,
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                                SizedBox(height: 10),
                                Container(
                                  padding: EdgeInsets.only(left: 10, right: 10),
                                  child: Column(
                                    crossAxisAlignment:
                                        CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        "工种: 管家",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                      SizedBox(height: 5),
                                      Text(
                                        "工作内容: 接孩子、家庭五口一日三餐、整理房间、清洁房间、开车接孩子上下学、剩下就是产品文档了。接孩子、家庭五口一日三餐、整理房间、清洁房间、开车剩下就是产品文档了。",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                      SizedBox(height: 5),
                                      Text(
                                        "工作属性: 2023年6月20日-2024年8月30日",
                                        style: TextStyle(
                                          fontSize: 14,
                                          color: myColors.c_707070,
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                                SizedBox(height: 10),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: Text(
                                    '雇主评价',
                                    style: TextStyle(
                                      fontSize: 14,
                                      color: myColors.c_191919,
                                      fontWeight: FontWeight.bold,
                                    ),
                                  ),
                                ),
                                SizedBox(height: 5),
                                Container(
                                  margin: EdgeInsets.only(left: 10, right: 10),
                                  child: MyGrid(
                                    children: List.generate(
                                      4,
                                      (index) => Container(
                                        height: 20,
                                        alignment: Alignment.center,
                                        decoration: BoxDecoration(
                                          borderRadius: BorderRadius.circular(
                                            3,
                                          ),
                                          color: Color(0xffF4F5F6),
                                        ),

                                        child: Text(
                                          'Item $index',
                                          style: TextStyle(
                                            color: myColors.c_191919,
                                          ),
                                        ),
                                      ),
                                    ),
                                    columnCount: 4, // 每行 4 列
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                  Positioned(left: 0, right: 0, bottom: 0, child: getFootBox()),
                ],
              ),
            ),
          ],
        ),
      ),
    );
  }

  Widget getTitleContent(String title) {
    return Container(
      height: 30,
      width: 120,
      padding: EdgeInsets.only(left: 10),
      alignment: Alignment.centerLeft,
      decoration: BoxDecoration(
        color: myColors.red,
        image: DecorationImage(
          image: AssetImage('assets/app/biaoti.png'),
          fit: BoxFit.cover,
          alignment: Alignment.center,
        ),
      ),
      child: Text(
        "${title}",
        style: TextStyle(
          color: myColors.c_191919,
          fontSize: 15,
          fontWeight: FontWeight.bold,
        ),
      ),
    );
  }

  Widget getFootBox() {
    return Container(
      width: MediaQuery.of(context).size.width,
      color: myColors.white,
      child: Column(
        children: [
          // Text('aaaa'),
          Container(
            width: MediaQuery.of(context).size.width,
            decoration: BoxDecoration(
              image: DecorationImage(
                image: AssetImage('assets/app/zhuangtai_bg2.png'),
                fit: BoxFit.fill,
              ),
            ),
            height: 30,
            child: Container(
              child: Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Text('订单还剩', style: TextStyle(color: myColors.white)),
                  CountdownTextSplit(timeStr: "23:59:59"),
                  // SizedBox(width: 10),
                  // CountdownTextSplit(timeStr: "8天:23:59:59"),
                ],
              ),
            ),
          ),
          Container(
            color: myColors.white,
            padding: EdgeInsets.all(10),
            child: Row(
              mainAxisSize: MainAxisSize.max,
              children: [
                // 左侧按钮们：退单、记录、待分享、完善信息、打电话
                Row(children: getFootTexts()),

                // 右侧按钮们
                Expanded(
                  child: Row(
                    //aaa
                    mainAxisSize: MainAxisSize.max,
                    children: getFootButtons(),
                  ),
                ),
              ],
            ),
          ),
        ],
      ),
    );
  }

  List<Widget> getFootTexts() {
    if (1 == 1) {
      return [
        // _buildSimpleButton('记录'),
        // _buildSimpleButton('锁定'),//在dart全部里面
        // _buildSimpleButton('取消锁定'),
        // _buildSimpleButton('推荐'),
        // _buildSimpleButton('收藏'),
        _buildSimpleButton('取消收藏','取消收藏'),
        _buildSimpleButton('完善信息','完善信息'),
        _buildSimpleButton('服务记录','服务记录'),
        _buildOutlinedButton('打电话'),
      ];
    }
    return [];
  }

  List<Widget> getFootButtons() {
    if (1 == 1) {
      return [
        Expanded(child: _buildSolidButton('建档')),
        // Expanded(child:  _buildVerticalButton('建档', '待支付')),
        // Expanded(child: _buildSolidButton('发起委托协议')),
        // Expanded(child: _buildVerticalButton('委托协议', '待签署')),
        // Expanded(child:   _buildVerticalButton('缴纳服务费', '待支付'))
      ];
    } else if (1 == 2) {}
    return [];
  }

  // 左侧通用短按钮
  Widget _buildSimpleButton(String text,String type) {
    return GestureDetector(
      onTap: () {
        if('服务记录'==type){
          utilRouter.to(ServerRecordPage());
          // showDialog(
          //   context: context,
          //   barrierDismissible: false, // 点击空白区域不关闭
          //   builder: (context) {
          //     return Dialog(
          //       insetPadding: EdgeInsets.zero, // 去除默认 margin
          //       backgroundColor: Colors.transparent, // 让背景透明（我们内容自己决定样式）
          //       child: ServerRecordDialog(), // 就是你的弹出框内容
          //     );
          //   },
          // );
        }else if('完善信息'== type){
          utilRouter.to(ServeResume());
        }
      },
      child: Container(
        width: 60,
        height: 40,
        alignment: Alignment.center,
        margin: const EdgeInsets.only(right: 6),
        child: Text(
          text,
          style: const TextStyle(fontSize: 14, color: Color(0xFF191919)),
        ),
      ),
    );
  }

  // 左侧：打电话按钮（红色边框）
  Widget _buildOutlinedButton(String text) {
    return Container(
      width: 70,
      height: 40,
      alignment: Alignment.center,
      margin: const EdgeInsets.only(left: 6),
      decoration: BoxDecoration(
        color: const Color(0xFFFFF9F9),
        border: Border.all(color: Color(0xFFFF4142)),
        borderRadius: BorderRadius.circular(50),
      ),
      child: Text(
        text,
        style: const TextStyle(
          fontSize: 14,
          fontWeight: FontWeight.bold,
          color: Color(0xFFFF4142),
        ),
      ),
    );
  }

  // 右侧：单行红底白字按钮
  Widget _buildSolidButton(String text) {
    return Container(
      width: 80,
      height: 40,
      alignment: Alignment.center,
      margin: const EdgeInsets.only(left: 8),
      decoration: BoxDecoration(
        color: const Color(0xFFFF4142),
        border: Border.all(color: Color(0xFFFF4142)),
        borderRadius: BorderRadius.circular(50),
      ),
      child: Text(
        text,
        style: const TextStyle(
          fontSize: 14,
          fontWeight: FontWeight.bold,
          color: Colors.white,
        ),
      ),
    );
  }

  // 右侧：两行按钮（标题 + 状态）
  Widget _buildVerticalButton(String title, String status) {
    return Container(
      width: 80,
      height: 40,
      margin: const EdgeInsets.only(left: 8),
      decoration: BoxDecoration(
        color: const Color(0xFFFF4142),
        border: Border.all(color: Color(0xFFFF4142)),
        borderRadius: BorderRadius.circular(50),
      ),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Text(
            title,
            style: const TextStyle(
              fontSize: 12,
              fontWeight: FontWeight.bold,
              color: Colors.white,
            ),
          ),
          Text(
            status,
            style: const TextStyle(
              fontSize: 12,
              fontWeight: FontWeight.normal,
              color: Colors.white,
            ),
          ),
        ],
      ),
    );
  }
}
